<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/css/css.css" rel="stylesheet" type="text/css" />
    <link href="/css/common.css" rel="stylesheet" tyle="text/css" />
    <script src="/js/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script src="/js/jquery.SuperSlide.2.1.1.js" type="text/javascript"></script>
    <script src="/js/common_js.js" type="text/javascript"></script>
    <script src="/js/axios.min.js"></script>
    <script src="/js/vue.js"></script>
    <title>用户登录</title>
    <script>
        $(function (){
            new Vue({
                el:"#app",
                data:{
                    account:"",
                    password:""
                },
                methods:{
                    login:function(){
                        //alert(this.account+"....."+this.password)
                        axios.post("/front/user/login",{
                            account: this.account,
                            password: this.password
                        }).then(r=>{
                           // alert(r.data)
                            if(r.data.code == 200){
                                alert("登录成功!!!")
                                location.href = "/front/user/index";
                            }if(r.data.code == 400){
                                alert("密码不正确，登录失败")
                                location.href = "/front/user/login";
                            }if(r.data.code == 401){
                                alert("用户名不存在，登录失败")
                                location.href = "/front/user/login";
                            }
                        })
                    }
                }
            })


        })
    </script>
</head>

<body>
<!--顶部样式-->
<div class="common_top" >
    <div class="Narrow">
        <div class=" left logo"><a href="#"><img th:src="@{/images/logo1.png}" alt="logo" height="139" width="247"/></a></div>
        <!--电话图层-->
        <div class="phone"><label>全国服务热线：</label><em>400-345-5633</em></div>
    </div>
</div>
<div class="login_bg" id="app">
    <div class="login Narrow">
        <div class="login_advertising"><img th:src="@{/images/login1.jpg}" height="675" width="1000"/></div>
        <div class="login_frame">
            <div class="login-form">
                <span th:text="${msg}"></span>
                <div class="login-name"><h1 class="name">用户登录</h1><span class="login_link"><a href="/front/user/registered"><b></b>用户注册</a></span></div>
                <!--提示信息-->
                <div class="form clearfix">
                    <div class="item item-fore1"><label for="loginname" class="login-label name-label"></label><input name="account" id="account" v-model="account" type="text"  class="text" placeholder="请输入用户" value=""/>
                    </div>
                    <div class="item item-fore2"><label for="nloginpwd" class="login-label pwd-label" ></label><input name="password" id="password" v-model="password" type="password"  class="text" placeholder="用户密码" value=""/>
                    </div>
                    <div class="Forgetpass"><a href="#">忘记密码？</a></div>
                </div>
                <div class="login-btn">
                    <a href="javascript:void(0)" class="btn_login" @click="login">登录</a>
                </div>
            </div>
            <div class="Login_Method">

            </div>
        </div>
    </div>
</div>
<!--底部样式-->
<div class="bottom_footer">
    <p><a href="#">关于我们</a> | <a href="#">联系我们</a> | <a href="#">商家入驻</a> | <a href="#">法律申明</a> | <a href="#">友情链接</a>  </p>
    <p>Copyright©2014四川金祥保险销售有限公司.All Rights Reserved. </p>
    <p>川ICP备09150084号</p>
</div>
</body>
</html>
